package EjerciciosNoBoletin2.Ex1;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.*;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.*;

public class ScrollDemo extends JFrame {

	private JPanel panel;
    public ScrollDemo(String nombreFoto) {
    	
        ImageIcon image = new ImageIcon(nombreFoto);

        panel = new JPanel();
        JLabel label = new JLabel(image);
        
        panel.add(label);
        
        JScrollPane scroll = new JScrollPane(panel);
        getContentPane().add(scroll);

        
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        
        this.setTitle("Fotos");
        this.pack();
        this.setVisible(true);
    }

    /*
    public static void main(String s[]) {
      ScrollDemo sd = new ScrollDemo();
        
    }
    */
}